home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
doors_2
/
twview91.zip
/
STATISTC.INC
< prev
next >
Wrap
Text File
|
1992-03-11
|
1KB
|
35 lines
procedure StellarDispersion;
const
maxDispersion = 29;
var
s : sector;
disperse : array [0..maxDIspersion] of integer;
average : longint;
total,
temp,
lost : integer;
begin
write( 'Stellar dispersion from what sector? ');
readln( s );
TwoWayDistances( s, distances, true, true );
for temp := 0 to maxDispersion do
disperse[ temp ] := 0;
lost := 0;
for s := 1 to maxSector do
if distances[s].d < maxint then
disperse[ distances[ s ].d ] := disperse[ distances[ s ].d ] + 1
else if space.sectors[s].number > 0 then { visited, but not connected?}
lost := lost + 1;
average := 0;
for temp := 0 to maxDispersion do
begin
average := average + temp * disperse[ temp ];
total := total + disperse[ temp ];
write( disperse[ temp ] : 5 );
if temp mod 10 = 9 then
writeln;
end;
writeln('There are ', lost, ' unreachable sectors, ', total, ' reachable sectors.');
writeln('Average distance to (known) sectors: ', average / total : 2 : 2);
end;